﻿using MengLin.OOP.DesignPattern.BridgePattern.DiffBrandPhoneDiffSystem.Bridge;
using MengLin.OOP.DesignPattern.BridgePattern.DiffBrandPhoneDiffSystem.Bridge.Memory.Implement;
using MengLin.OOP.DesignPattern.BridgePattern.DiffBrandPhoneDiffSystem.Bridge.Memory.Interface;
using MengLin.OOP.DesignPattern.BridgePattern.DiffBrandPhoneDiffSystem.Bridge.System.Implement;
using MengLin.OOP.DesignPattern.BridgePattern.DiffBrandPhoneDiffSystem.Bridge.System.Interface;
using MengLin.OOP.DesignPattern.BridgePattern.DiffBrandPhoneDiffSystem.ClassBlastMore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.BridgePattern.DiffBrandPhoneDiffSystem
{
    class Program
    {
        static void Main(string[] args)
        {
            #region 通过继承，类爆炸
            //{
            //    Console.WriteLine("******************************");
            //    {
            //        AbstractBasePhone phone = new IPhone();
            //        phone.Call();
            //        phone.SendMessage();
            //    }
            //    Console.WriteLine("******************************");
            //    {
            //        AbstractBasePhone phone = new IPhoneAndroid32G();
            //        phone.Call();
            //        phone.SendMessage();
            //    }
            //    Console.WriteLine("******************************");
            //    {
            //        AbstractBasePhone phone = new LumiaAndroid256G();
            //        phone.Call();
            //        phone.SendMessage();
            //    }
            //    Console.WriteLine("******************************");
            //    {
            //        AbstractBasePhone phone = new IPhoneWindowsPhone256G();
            //        phone.Call();
            //        phone.SendMessage();
            //    }
            //}
            #endregion

            #region 通过在抽象层组合
            {
                ISystem androidSystem = new AndroidSystem();
                ISystem iosSystem = new IOSSystem();
                ISystem windowsPhoneSystem = new WindowsPhoneSystem();

                IMemory _32GMemory = new _32GMemory();
                IMemory _64GMemory = new _64GMemory();
                IMemory _128GMemory = new _128GMemory();
                IMemory _256GMemory = new _256GMemory();

                Console.WriteLine("******************************");
                {
                    AbstractBasePhoneBridge phone = new IPhoneBridge();
                    phone.System = androidSystem;
                    phone.Memory = _32GMemory;
                    phone.Call();
                    phone.SendMessage();
                }
                Console.WriteLine("******************************");
                {
                    AbstractBasePhoneBridge phone = new IPhoneBridge();
                    phone.System = iosSystem;
                    phone.Memory = _64GMemory;
                    phone.Call();
                    phone.SendMessage();
                }
                Console.WriteLine("******************************");
                {
                    AbstractBasePhoneBridge phone = new IPhoneBridge();
                    phone.System = windowsPhoneSystem;
                    phone.Memory = _256GMemory;
                    phone.Call();
                    phone.SendMessage();
                }
            }
            #endregion
            Console.Read();
        }
    }
}
